fix(redshift): escape SQL identifiers and literals in metadata/DDL paths (#1914) - #2203
Merged
Merged
Conversation
…r maintainer review (OtterMind#1914) - new RedshiftIdentifierProcessor (SPI ISQLIdentifierProcessor): quoteIdentifier with double-quote doubling, escapeString with single-quote doubling - RedshiftMetaData overrides getSQLIdentifierProcessor(); SHOW CREATE TABLE call site uses RedshiftIdentifierProcessor.INSTANCE - RedshiftSqlEscapes removed; tests migrated (9 green)
…uote for DDL paths (OtterMind#1914) - quoteIdentifier(String) is conditional again: null/blank passthrough, valid plain identifiers returned unquoted, otherwise wrapped with double quotes after stripping one pair and doubling embedded quotes - new quoteIdentifierAlways(String) for DDL-generation sites; buildShowCreateTableSql uses it (was RedshiftSqlEscapes.quoteIdentifier) - quoteIdentifierIgnoreCase keeps the always-quote SPI variant meaning; versioned overload delegates to quoteIdentifier(String) - tests cover both conditional and always behaviors incl. null passthrough
…uoted identifier) (OtterMind#1914)
Reuse the verified PostgreSQL processor, preserve raw identifier round trips, and handle optional SHOW CREATE TABLE schema qualification. Co-authored-by: HandSonic <8078023+handsonic@users.noreply.github.com>
openai0229
force-pushed
the
fix/sqli2-redshift
branch
from
July 29, 2026 10:38
fc66ef6 to
f236b4f
Compare
openai0229
approved these changes
Jul 29, 2026
openai0229
left a comment
Contributor
There was a problem hiding this comment.
Maintainer review complete. Redshift now reuses the verified PostgreSQL identifier contract, preserves exact quote/remove round trips, and passes the clean 9-module reactor with all 182 tests green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #1914
Summary
Completes the Redshift database-plugin portion of the identifier and literal escaping work.
SHOW CREATE TABLEschema/table names, supports an omitted schema, and rejects a missing table name.Affected surfaces
Verification
mvn -B -f chat2db-community-server/pom.xml -pl chat2db-community-plugins/chat2db-community-redshift -am -DskipTests=false -Dmaven.test.skip=false clean testBUILD SUCCESSacross 9 reactor modules; 182 tests passed in tested modules, including Redshift17/17, PostgreSQL49/49, SPI90/90, and tools26/26.git diff --check origin/main...HEAD: passed.Risk and compatibility
ISQLIdentifierProcessorcontract.Reviewer map
RedshiftIdentifierProcessor, thenRedshiftMetaData.buildShowCreateTableSqlandRedshiftIdentifierProcessorTest.Contributor declaration
AI assistance: Substantial AI-assisted maintainer revision and test expansion; all final changes were source-reviewed and verified with the commands above.